package com.lyxy.mapper;

import com.lyxy.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;

public interface UserMapper {
    int getUserCount();

    User getUserById(int id);

    int insertUser();
    int insertUserByUser(User user);

    int updateUser();
    int deleteUser();

    List<User> getUserByUsername(String username);
    List<User> getUserByUsername2(String username);

    List<User> getUserByUsernameAndPassword(String username,String password);
    List<User> getUserByUsernameAndPassword2(@Param("name") String username, @Param("pwd") String password);
    List<User> getUserByMap(Map<String, Object> map);

    List<User> getUserList1(@Param("userName") String userName,@Param("userRole") Integer roleId);
    List<User> getUserList2(@Param("userName") String userName,@Param("userRole") Integer roleId);
    List<User> getUserList3(@Param("userName") String userName,@Param("userRole") Integer roleId);
    List<User> getUserList4(@Param("userName") String userName, @Param("userRole") Integer roleId, @Param("creationDate")Date creationDate);

    int updateUserBySet(User user);
    List<User> getUserListByArray(@Param("ids") Integer[] ids);//array
    List<User> getUserListByList(List<Integer> ids);//array
    List<User> getUserListByMap(Map<String,Object> map);
    List<User> getUserByStringIds(String ids);
    List<User> getUserListByPage1(@Param("from")Integer from,@Param("pageSize")Integer pageSize);
    List<User> getUserListByPage2(RowBounds rowBounds);
    List<User> getUserListByPage3();

    User getUserById2(@Param("id")Integer id);
}
